# -*- coding: utf-8 -*-
from django.db import models

class Keywords(models.Model):
    key = models.CharField(maxlength=100,verbose_name='视频关键词',unique=True)
    
    def __str__(self):
      return '%s' % self.key
    
    class Meta:
      db_table = "yaoflv_Keywords"
      verbose_name = '视频关键词'
      verbose_name_plural = '视频关键词管理'
    
    class Admin:
      list_display = ('id', 'key')

class noKeywords(models.Model):
  key = models.CharField(maxlength=100,verbose_name='视频关键词',unique=True)

  def __str__(self):
    return '%s' % self.key

  class Meta:
    db_table = "yaoflv_noKeywords"
    verbose_name = 'no视频关键词'
    verbose_name_plural = 'no视频关键词管理'

  class Admin:
    list_display = ('id', 'key')

class Flv(models.Model):
    flvvid = models.CharField(maxlength=100,verbose_name='视频编号',unique=True)
    flvname = models.CharField(maxlength=100,verbose_name='视频名')
    flvsrc = models.CharField(maxlength=100,verbose_name='视频下载地址',unique=True)
    flvurl = models.CharField(maxlength=100,verbose_name='视频观看地址',unique=True)
    flvimg = models.CharField(maxlength=100,verbose_name='视频图片',unique=True)
    key = models.ForeignKey(Keywords)

    def __str__(self):
        return '%s' % self.flvname
    
    class Meta:
        db_table = "yaoflv_Flv"
        verbose_name = '视频名'
        verbose_name_plural = '视频名管理'
    
    class Admin:
        list_display = ('id', 'flvname')